package com.zl.service;



import java.util.List;

import org.hibernate.criterion.DetachedCriteria;
import org.springframework.transaction.annotation.Transactional;

import com.zl.dao.CustomerDao;
import com.zl.domain.Customer;
import com.zl.domain.PageBean;
import com.zl.service.CustomerService;
@Transactional
public class CustomerServiceImpl implements CustomerService{

	private CustomerDao customerDao;
	public void setCustomerDao(CustomerDao customerDao) {
		this.customerDao = customerDao;
	}
	@Override
	public PageBean<Customer> findAllByPage(Integer pageCode, Integer pageSize, DetachedCriteria criteria) {
		// TODO Auto-generated method stub
		
		
		return customerDao.findByPage(pageCode,pageSize,criteria);
	}
	@Override
	public void save(Customer customer) {
		// TODO Auto-generated method stub
		customerDao.save(customer);
	}
	@Override
	public Customer findById(Long cust_id) {
		// TODO Auto-generated method stub
		return customerDao.findById(cust_id);
	}
	@Override
	public void delete(Customer customer) {
		// TODO Auto-generated method stub
		customerDao.delete(customer);
	}
	@Override
	public void update(Customer customer) {
		// TODO Auto-generated method stub
		customerDao.update(customer);
	}
	@Override
	public List<Customer> findAll() {
		// TODO Auto-generated method stub
		return customerDao.findAll();
	}



	

	

}
